<script setup>
import { reactive } from 'vue'
import { ElMessage } from 'element-plus'
import {useRouter} from 'vue-router'
const formLabelAlign = reactive({
    name: '',
    password: '',
    pw: '',
})
const router = useRouter();
const login = ()=>{
    if(formLabelAlign.name!="admin" || formLabelAlign.password!="passwordTicket"){
        ElMessage.error('用户名或密码错误！！！')
    }else if( formLabelAlign.pw != 'planeTicket2022'){
        ElMessage.error('内部密码有误！！！')
    }else{
        router.push({
            path:'/nacos'
        })
        sessionStorage.setItem('token','plane')
    }
}
</script>
<template>
    <h1 class="title">协途出行内部管理服务</h1>
    <div class="from">

        <el-form label-position="top" :model="formLabelAlign">
            <el-form-item label="管理者用户名" >
                <el-input v-model="formLabelAlign.name" />
            </el-form-item>
            <el-form-item label="密码">
                <el-input v-model="formLabelAlign.password" type="password"/>
            </el-form-item>
            <el-form-item label="内部密码">
                <el-input v-model="formLabelAlign.pw" type="password" />
            </el-form-item>
            <el-button type="primary" class="bu" @click="login()">登录</el-button>
        </el-form>
    </div>
</template>
<style scoped>
.from {
    margin:0px auto;
    width: 500px;
    height: 300px;
    border: 1px solid black;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 30px;
}

.title {
    margin:0 auto;
    margin-top:200px;
    width: 330px;
}
.bu{
    margin-left:50px;
}
</style>